package com.dukun.mybatis.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.Getter;
import lombok.Setter;

/**
 * 学历枚举类
 *
 * author：dukun
 * date：2021/10/20
 */
@Getter
public enum GradeEnum {

    PRIMARY(0, "小学"),

    SECONDORY(1, "中学"),

    HIGH(2, "高中"),

    UNIVERSITY(3, "大学及以上");

    // 返回给前段的值
    @JsonValue
    // 在数据库存储的值
    @EnumValue
    private final int code;

    private final String des;

    GradeEnum(int code, String des) {
        this.code = code;
        this.des = des;
    }
}
